package edu.zqu.collegeField.framework.activiti.service;


import org.activiti.engine.runtime.ProcessInstance;

public class ActivitiRuntime extends ActivitiBase {
    //判断流程是否执行完毕
    public static boolean processState(String processInstanceId) {
        ProcessInstance pi = runtimeService.createProcessInstanceQuery()
                .processInstanceId(processInstanceId) // 用流程实例id查询
                .singleResult();
        if (pi != null) {
            System.out.println("流程正在执行！");
            return true;
        } else {
            System.out.println("流程已经执行结束！");
            return false;
        }
    }
}
